home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 23 Feb 1996 16:55:25 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Distribution: world
- Message-ID: <4gkrht$d5l@maureen.teleport.com>
- References: <4fq6m6$gah@maureen.teleport.com> <38232456@kone.fipnet.fi> <4g7t86$em3@maureen.teleport.com> <38232527@kone.fipnet.fi>
- NNTP-Posting-Host: julie.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jyrki Saarinen (jsaarinen@kone.fipnet.fi) wrote:
-
- : > : Hmm. I have 15 long divides per polygon. (Texture/Gouraud)
- : > : Now if they take about 30 cycles, only ~15 pixels have to be
- : > : drawn to take the same amount of cycles. Therefore I dont
- : > : use a divide table now..
- : >
- : > My guess is that you draw only a few polygon per frame...
- : > But 15 pixels , ~450 cycles really addup when you draw alot of
- : > polygon. If you draw 100 triangle at 60fps and your not using a
- : > 512 byte divtable then your rendering code will take 10% more CPU
- : ^^^^^^^^^^^^^^^^^
- : > 2700000 cycles extra ... Yep, it addup quick :)
-
- : I dont think that is really enough ... besides, you must use
- : muls for 1/x table because the divided value can be negative, too.
- : So 16.16 not possible, only 15b of fraction.
-
- : Please explain your calculations a little..
-
- a mul?.w is 27, a muls.l is 43
- a divs.l is 90
-
- -- what you do with muls.l is:
-
- setup
- move.l (a2,d0.w*4),d1 ;done upto 4 time per poly
-
- opp:
- ext.l d2
- muls.l d1,d2 ; 2+43 * upto 15time = 675
-
-
- -- with div:
-
- setup
- ext.l d0 ; done upto 4 time per poly
-
- opp:
- swap d2
- sub.w d2,d2
- divs.l d2,d0 ;4+2+90 * 15 = 1440
-
- now, (1440+8-675-28) * 60 * 100 = 4.47 mcycle.
-
- You dont have to fall back to 15bit precision to gain the speed
- from mul VS div... using 15bit give you an extra 6.03 mcycle, or
- you could use mulu.w and adjust the sign?
-
- Myself I will stick with 16:16 and muls.l on 68030 and under.
- a divs.l is ~2time slower then a muls.l and ~3.5 slower then a muls.w
- On a 68000 I would go with 15bit and muls + an add.l: 76 cycle... ouch ,
- but still less then a divs.l on a 030 ;) (To bad the 68000 mhz is so
- limited:)
-
- Stephan
-